home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: phcoms4.seri.philips.nl!panther!baynes
- From: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes)
- Subject: It this portable?
- Sender: news@ukpsshp1.serigate.philips.nl (account for localnews)
- Message-ID: <Dpp1tv.4Kq@ukpsshp1.serigate.philips.nl>
- Date: Thu, 11 Apr 1996 10:44:17 GMT
- Organization: Philips Semiconductors, Southampton, UK
- X-Newsreader: TIN [version 1.2 PL2]
-
- In a glossy newsletter from a company (who had better remain nameless) that
- sells tools for testing and validating C code the following bit of code was
- given as an example of implementation dependent but portable code across ISO
- C implementations. I know 'portable' is not a term used in the standard, let
- us assume it means conforming. Is this program conforming, giving an
- implementation defined result (regardless of the fact the result is probably
- not the one intended) or is it going to give undefined behaviour?
-
-
- #include <stdio.h>
- #include <limits.h>
- int main( void )
- {
- printf( "%d", UINT_MAX );
- return 0;
- }
-
- My vote is for undefined, but can anyone construct an argument based on
- the represention of integers that makes it implmentation defined?
-
- --
- Stephen Baynes baynes@ukpsshp1.serigate.philips.nl
- Philips Semiconductors Ltd
- Southampton My views are my own.
- United Kingdom
- Are you using ISO8859-1? Do you see ⌐ as copyright, ≈ as division and ╜ as 1/2?
-